<%-- 
    Document   : AddOeuvre
    Created on : 11 nov. 2012, 16:08:51
    Author     : Thomas
--%>
<%@page import="java.util.Vector"%>
<%@page import="enterprise.web_jpa_war.entity.Type"%>
<%@page import="enterprise.web_jpa_war.servlet.Fonctions"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <title>Mediatheque : Ajouter une oeuvre</title>
        <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
        <link type="text/css" rel="Stylesheet" media="screen" href="Css/design.css">
        <link type="text/css" rel="Stylesheet" media="screen" href="Css/bootstrap.min.css">
        <link href="Images/favicon.png" type="image/png" rel="icon">
    </head>
    <body>
        
        <%
        Fonctions f = new Fonctions();
        out.print(f.printNavBar());
        Vector<Type> types = (Vector<Type>) request.getAttribute("typeList");
        %>
        
        <div class="container-fluid">
            
        <%
        out.print(f.printSideBar());
        %>
            
        <div class="content">
            <div class="hero-unit">
                <div class="page-header">
                    <h1 id="titre">Mediatheque : Ajouter une oeuvre</h1>
                    <h3>Remplissez le formulaire suivant pour ajouter une oeuvre au catalogue</h3>
                </div>
                <div class="well bloc_texte">
                    <form id="createNewOeuvre" action="AddOeuvre" method="post">
                        <table>
                            <tr><td>Titre</td><td><input type="text" id = "titreOeuvre" name="titreOeuvre" /></td></tr>
                            <tr><td>Auteur</td><td><input type="text" id = "auteur" name="auteur" /></td></tr>
                            <tr><td>Date d'edition (jj/mm/aaaa)</td><td><input type="text" id = "dteedition" name="dteedition" /></td></tr>
                            <tr><td>Genre</td><td><input type="text" id = "genre" name="genre" /></td></tr>
                            <tr><td>Description</td><td><input type="text" id = "description" name="description" /></td></tr>
                            <tr>
                                <td>Type</td>
                                <td><select id="type" name="type">
                                        <% if(types != null) { for(Type t : types) { %>
                                        <option value="<% out.print(t.getTypeName()); %>"><% out.print(t.getTypeName()); %></option>
                                         <% } } %>
                                </select></td>
                                <!--<c:forEach var="type" begin="0" items="${requestScope.typeList}">
                                    <tr><td>${type.typeName}</td></tr>
                                </tr>
                                </c:forEach>-->
                            </tr>
                        </table>
                        <div class="actions" style="padding-left:0px">
                            <input id="btn_envoyer" class="btn large primary" type="submit" value="Ajouter Oeuvre">
                        </div>
                    </form>
                    <a href='index.jsp'><strong>retour au menu principal</strong></a>
                </div>
            </div>
        </div>
    </body>
</html>
